package com.sq.partner.manager.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.sq.partner.manager.dao.FacadeAppBeneficiaryDao;
import com.sq.partner.manager.mybatis.model.FacadeAppBeneficiary;

@Repository
public class FacadeAppBeneficiaryDaoImpl extends BaseDaoImpl implements
        FacadeAppBeneficiaryDao {

    /**
     * 获取客户号
     * 
     * @param string
     * @return
     * @throws Exception
     */
    @Override
    public String queryNewSyrClientNo() throws Exception {
        return (String) query("queryNewSyrClientNo", "SYR");
    }

    /**
     * 插入受益人表
     * 
     * @param facadeAppBeneficiary
     * @throws Exception
     */
    @Override
    public void insertFacadeAppBeneficiary(
            FacadeAppBeneficiary facadeAppBeneficiary) throws Exception {
        add("insertFacadeAppBeneficiary", facadeAppBeneficiary);
    }

    /**
     * 根据投保单号删除受益人信息
     * 
     * @param appNo
     * @return
     * @throws Exception
     */
    @Override
    public void delFacadeAppBeneficiaryByAppNo(String appNo) throws Exception {

        this.delete("delFacadeAppBeneficiaryByAppNo", appNo);
    }

    /**
     * 查询受益人信息
     * 
     * @param map
     * @return list
     * @throws Exception
     */
    @SuppressWarnings("unchecked")
    @Override
    public List<FacadeAppBeneficiary> selectFacadeAppBeneficiaryByMap(
            Map<String, String> map) throws Exception {
        return (List<FacadeAppBeneficiary>) this.queryList(
                "queryFacadeAppBeneficiaryByMap", map);
    }

}
